package com.crayon2f.test;

import cn.hutool.core.collection.CollectionUtil;
import com.crayon2f.test.beans.Book;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

/**
 * Created by feifan.gou@gmail.com on 2024/3/11 15:25.
 */
public class TEST2024_06 {


    @Test
    public void testCollector() {

        List<String> list1 = Lists.newArrayList("1", "2", "3");
        List<String> list2 = Lists.newArrayList("a", "b", "c");
        Map<String, List<String>> map = ImmutableMap.of("a1", list1, "a2", list2);
        ArrayList<String> collect = map.values()
                .stream().collect(Lists::newArrayList, ArrayList::addAll, (pre, next) -> {});
        System.out.println(collect);

        Book book = new Book();
        Book book2 = new Book();

        String str = book.getNullStr() + book2.getNullStr();

        System.out.println("null");

        CollectionUtil.split(list1,5).forEach(ths -> System.out.println(ths.size()));

    }
}
